<?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\Admin\Arts\Manage\ArticleController;
use App\Http\Controllers\Admin\Arts\Manage\ArticleTypeController;
use App\Http\Controllers\Admin\Arts\Manage\BannerController;
use App\Http\Controllers\Admin\Arts\Manage\UserController;
use App\Http\Controllers\Admin\Arts\Manage\SmsController;
use App\Http\Controllers\Admin\Arts\Manage\WebArticleController;
use App\Http\Controllers\Admin\Arts\Manage\WebBannerController;
use App\Http\Controllers\Admin\Arts\Manage\WebMenusController;
use App\Http\Controllers\Admin\Arts\Manage\WebPartnerController;
use App\Http\Controllers\Admin\Arts\Setup\PageController;

// 校验登录
Route::group(['middleware' => ['admin.sign']], function () {
    // 基础架构
    Route::group(['prefix' => 'arts'], function () {

        // 设置 arts/setup/page/{__table}
        Route::group(['prefix' => 'setup'], function () {
            Route::any("page/{__table}", [PageController::class, 'index']);
            Route::any("pageGetSetup", [PageController::class, 'getSetup']);
            Route::any("pageUpdateSetup", [PageController::class, 'updateSetup']);
        });

        // 主要功能
        Route::group(['prefix' => 'manage'], function () {
            // 用户管理
            Route::any("user", [UserController::class, 'index']);
            Route::any("user/status", [UserController::class, 'status']);
            Route::any("user/remove", [UserController::class, 'remove']);

            // 短信验证码管理
            Route::any("sms", [SmsController::class, 'index']);
            Route::any("sms/status", [SmsController::class, 'status']);
            Route::any("sms/remove", [SmsController::class, 'remove']);

            // 网站栏目管理
            Route::any("web_menus", [WebMenusController::class, 'index']);
            Route::any("web_menus/insert", [WebMenusController::class, 'insert']);
            Route::any("web_menus/update", [WebMenusController::class, 'update']);
            Route::any("web_menus/status", [WebMenusController::class, 'status']);
            Route::any("web_menus/remove", [WebMenusController::class, 'remove']);
            Route::any("web_menus/rank", [WebMenusController::class, 'rank']);

            // 文章管理
            Route::any("web_article", [WebArticleController::class, 'index']);
            Route::any("web_article/insert", [WebArticleController::class, 'insert']);
            Route::any("web_article/update", [WebArticleController::class, 'update']);
            Route::any("web_article/status", [WebArticleController::class, 'status']);
            Route::any("web_article/remove", [WebArticleController::class, 'remove']);
            Route::any("web_article/rank", [WebArticleController::class, 'rank']);
            Route::any("web_article/type", [WebArticleController::class, 'type']);

            // 轮播图管理
            Route::any("web_banner", [WebBannerController::class, 'index']);
            Route::any("web_banner/insert", [WebBannerController::class, 'insert']);
            Route::any("web_banner/update", [WebBannerController::class, 'update']);
            Route::any("web_banner/status", [WebBannerController::class, 'status']);
            Route::any("web_banner/remove", [WebBannerController::class, 'remove']);
            Route::any("web_banner/rank", [WebBannerController::class, 'rank']);

            // 合作伙伴
            Route::any("web_partner", [WebPartnerController::class, 'index']);
            Route::any("web_partner/insert", [WebPartnerController::class, 'insert']);
            Route::any("web_partner/update", [WebPartnerController::class, 'update']);
            Route::any("web_partner/status", [WebPartnerController::class, 'status']);
            Route::any("web_partner/remove", [WebPartnerController::class, 'remove']);
            Route::any("web_partner/rank", [WebPartnerController::class, 'rank']);
            Route::any("web_partner/list_page", [WebPartnerController::class, 'list_page']);

            // 公告文章
            Route::any("article", [ArticleController::class, 'index']);
            Route::any("article/insert", [ArticleController::class, 'insert']);
            Route::any("article/update", [ArticleController::class, 'update']);
            Route::any("article/status", [ArticleController::class, 'status']);
            Route::any("article/remove", [ArticleController::class, 'remove']);
            Route::any("article/rank", [ArticleController::class, 'rank']);
            Route::any("article/type", [ArticleController::class, 'type']);

            // 公告文章分类
            Route::any("article_type", [ArticleTypeController::class, 'index']);
            Route::any("article_type/insert", [ArticleTypeController::class, 'insert']);
            Route::any("article_type/update", [ArticleTypeController::class, 'update']);
            Route::any("article_type/status", [ArticleTypeController::class, 'status']);
            Route::any("article_type/remove", [ArticleTypeController::class, 'remove']);
            Route::any("article_type/rank", [ArticleTypeController::class, 'rank']);

            // banner
            Route::any("banner", [BannerController::class, 'index']);
            Route::any("banner/insert", [BannerController::class, 'insert']);
            Route::any("banner/update", [BannerController::class, 'update']);
            Route::any("banner/status", [BannerController::class, 'status']);
            Route::any("banner/remove", [BannerController::class, 'remove']);
            Route::any("banner/rank", [BannerController::class, 'rank']);
        });

    });

});